Repository navigation
fix(routing): back off first-content exploration after failed explorations - #1270
brandon-eigenlabs wants to merge 2 commits into
Conversation
|
@brandon-eigenlabs is attempting to deploy a commit to the EigenLabs Team on Vercel. A member of the Team first needs to authorize it. |
Threat model review — advisoryReviewed head Review not completed for this head. Previous findings are superseded, not confirmed resolved. Reviewers: anthropic/claude-opus-5.5: incomplete (review unavailable); openai/gpt-6-astra: incomplete (review unavailable) Models: anthropic/claude-opus-5.5, openai/gpt-6-astra. Findings require human validation; this review never requests changes or blocks merging. |
…tions prices it at the fleet median. A provider whose engine keeps resetting clears that evidence every few minutes, and a first-content timeout is a 429 the node-health breaker deliberately ignores. In production one such provider (M3 Max decoding at ~11 tok/s against a ~79 fleet median) failed most of the explorations it won for hours with no tracker reacting. Two per-identity checks, scoped to exploration only: - Outcome backoff. An attempt selected through exploration reports back: a first-content timeout, deadline refusal or genuine fault (the breaker's own fault test) doubles a per-model suppression interval (5 min to 2 h); a delivered request halves it. Reset-on-success would not stop a provider that still completes short requests. - Remembered decode rate. Newly measured decode rates are kept per model across evidence resets and reconnects; a median of at least 5 below 0.25x the (model, chip family) fleet median makes the provider non-explorable. One slow observation never decides (the Layr-Labs#1238 lock-out); an observation at >= 0.5x clears the memory. Both live on the stable-identity gate (merged on migration, swept after 6 h, cleared by a provider version change). Neither quarantines: a suppressed provider still serves when nothing is feasible, and deadline refusals and first-content timeouts stay neutral for every health breaker. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…aring rationale The shared exploration fixture priced the idle provider at 20,000 tok/s prefill, which no provider reports (Layr-Labs#1238 review). Use 2,000: still more than a fast band ahead of the qualified peer's measured 1,200, so the tests stay deterministic, and within the measured range. Also correct the rationale in comments and docs. The degraded provider's steps_executed returning to 0 is normal per-interval reporting on 0.9.11 and 0.9.12, not an engine reset. What makes exploration repeat is routine: idle providers clear their decode evidence a few times an hour (fleet median ~3/h on 0.9.11), so a slow provider is explorable again and again. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
7188d96 to
3e980ff
Compare
Review of #1276 found that the median replaced a fresh own rate when the other rate was undated. The evidence gap needs both measurements dated, so the provider stayed admitted after a served request. On the explicit path a cache-hit request renews decode but not isolated prefill. On the legacy path the first EWMA after connect is undated by design. In both cases the median kept the fresh value out of the cost. Keep one admitted flag on the snapshot, and add the age of each dated measurement. resolveEffectiveTPS uses the decode median only while the provider's own decode evidence is missing or at least 5 minutes old. resolvePrefillTPS does the same for isolated prefill. An undated value counts as the provider's own evidence. Do not note a TTFT calibration prediction when its cost used a median. Docs: state the per-rate rule, the no-deadline behavior change, the capacity_before_refusal case, the isolated-versus-observed prefill difference, and the dependency on #1270 for a provider that is slow on every request. Move the SetPrefillToDecodeRatio sentence back to the fallback paragraph. Refs #1238 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merge-order note with #1276 (median pricing for explored providers; review). The two PRs compose. On a local merge only #1276 should not land before this one. Priced at the median, a genuinely slow provider with stale evidence won 10 of 20 consecutive requests on #1276 alone, every one a timeout, and 1 of 20 with this PR merged in. Follow-up if #1276 lands first: this PR tags an attempt as explored via |
Point the tps_prefill.go header at first_content_exploration_pricing.go, where the pricing moved. State the #1270 known limit only in routing.md and rewrap the first-content-routing.md paragraph. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Superseded by #1371: #1371 . The replacement consolidates #1243, #1270 and #1276 on current master, preserves exploration backoff and remembered slow-rate safeguards, and credits @brandon-eigenlabs as the original author in both the PR description and signed commit co-author trailers. It also addresses the reviewed no-deadline/vision median-pricing feedback gap and prevents duplicate timeout/fault feedback. Combined local normal/race suites, schema checks, builds, lint and docs checks pass; hosted review/CI are now running on the replacement. Closing only to keep one review/merge target; thank you for the original contribution and cross-PR review. |
…off (#1371) * fix(routing): consolidate idle provider recovery and exploration backoff Port the complementary fixes from #1243, #1270 and #1276 onto the current domain-owned coordinator. Preserve independent decode aging, per-rate exploration pricing, stable-identity suppression, and existing physical admission and provider-health policy. Close the integration gaps for median-priced deadline-exempt attempts, duplicate timeout/fault feedback, reviewed-profile attribution, and invalid explicit metadata replay. Retain the closed-loop starvation regressions and add live-registry, outcome, identity and race coverage. Original contributions: #1243 by JT Rose, #1270 by Brandon Curtis, and #1276 by David Tai; earlier #1243 integration by jonathan308. Co-authored-by: JT Rose <rosejt24@gmail.com> Co-authored-by: Brandon Curtis <brandon@eigenlabs.org> Co-authored-by: David Tai <dtaipublic@gmail.com> Co-authored-by: jonathan308 <5055076+jonathan308@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * fix(routing): preserve evidence identity across reconnects Address the three Codex review findings on #1371: preserve newer healthy clears independently of outcome timestamps, distinguish explicitly missing rate evidence from legacy EWMAs, and deduplicate corroborating observations across reconnects and identity merges. Bound producer watermarks and expiry fences, preserve healthy-only routing read fast paths, and add regression coverage for provenance replay, chronology, saturation, recovery and real reservation behavior. Original contribution attribution remains in the consolidation commit. --------- Co-authored-by: JT Rose <rosejt24@gmail.com> Co-authored-by: Brandon Curtis <brandon@eigenlabs.org> Co-authored-by: David Tai <dtaipublic@gmail.com> Co-authored-by: jonathan308 <5055076+jonathan308@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Follow-up to #1254. Evidence exploration admits an idle provider without current performance evidence and prices it at the fleet median. Three things combine so that a degraded provider can keep winning explorations it cannot serve:
resolveEffectiveTPSfalls back to the fleet median, so a 10 tok/s box is priced like a normal one and winsunique_min.providerOutcomeIsFaultdeliberately ignores.deadline_unreachableis health-neutral by design. So the node-health breaker, ejection and reputation never react.Production case (read replica, 2026-09-30, aggregates only): an M3 Max (48 GB, 40-core GPU) on 0.9.11 reported decode at 10–12 tok/s against an M3-family median of 92 (0.11×), and isolated prefill at 80–160 against ~1,200. Its decode evidence cleared about 4 times an hour (normal: fleet median ~3/h), and its slot reported a state outside the known set (folded to
other) about 12 times an hour (fleet p90 under 1/h). It stayedeligiblethroughout, with no breaker, cooldown, ejection orwedge_suspected. In the profiler's 11–33% sample it was selected about once a minute for 90+ minutes. It served only short prompts (5–10 s to first content, against 0.5–4 s forecasts) and timed out on everything over ~1,650 prompt tokens. It produced 19 of the 29 explorablefirst_chunk_timeouts for gemma between 03:00 and 06:00Z.Change
Two per-identity checks. Both are scoped to exploration only.
Outcome backoff. The reservation commit records whether the winner was selected through the idle exception (
PendingRequest.SetFirstContentExplored). That attempt's outcome then feeds back:first_chunk_timeout(atcancelDispatchForFirstContentTimeout),deadline_unreachable, and a genuine fault (the breaker's ownproviderOutcomeIsFault, after all neutral, drain and typed-cause gates). Each doubles a per-model suppression interval, from 5 min up to 2 h.Reset-on-success, as the breaker uses, would not stop this provider, because it still completes short prompts.
Remembered decode rate. The heartbeat records each newly measured decode rate per model. The record lives beyond evidence clearing and reconnects. When the median of at least 5 recent observations is below 0.25× the (model, chip family)
tpsRegistrymedian, the provider is not explorable.Where the state lives. Both are stored as one per-model map on the stable-identity gate (
gateFlagExploration, with the lock-free fast path). They are merged on identity migration (stricter state wins), swept after 6 h, and cleared by a provider version change (noteIdentityVersionLocked). The snapshot copies the view, andfirstContentEvidenceExplorablechecks it, so the scan, retained-plan and commit re-check paths all agree.Neither is a quarantine. A suppressed provider keeps ordinary feasible-first behaviour and is still selected when no candidate is feasible. Deadline refusals and first-content timeouts remain neutral for every health breaker; a test pins that.
Before
After
flowchart TD A["Idle, genuinely slow provider"] --> C{"firstContentEvidenceExplorable"} C -->|"suppressed or<br/>remembered slow"| N["Not explorable<br/>feasible-first unchanged"] C -->|"otherwise"| D["Wins exploration<br/>SetFirstContentExplored(true)"] D -->|"timeout / refusal / fault"| X["RecordFirstContentExplorationOutcome(false)<br/>backoff doubles"] D -->|"delivered"| Y["RecordFirstContentExplorationOutcome(true)<br/>backoff halves"] H["Heartbeat: new decode rate"] --> M["Remembered rates on gate<br/>median of ≥5 vs 0.25× family median"] X --> C Y --> C M --> C classDef input fill:#dbeafe,stroke:#2563eb,color:#172554 classDef check fill:#fef3c7,stroke:#d97706,color:#451a03 classDef outcome fill:#dcfce7,stroke:#16a34a,color:#14532d class A,H input class C check class N,D,X,Y,M outcomeBlue: inputs. Amber: the exploration decision. Red/green: the loop before and after.
Evidence for the thresholds
The 0.25× threshold. These are explorable gemma attempts from 03:00 to 06:00Z, bucketed by each provider's latest measured decode rate against its chip-family median:
The gate needs a median of ≥ 5 observations, not one, so it is stricter than this table.
Replay on the provider above. Using its own coordinator snapshots, the remembered-rate gate engages 22 min after its first slow observation and never clears. That would have blocked every one of its sampled explorations from 03:31Z on.
Validation
first_content_exploration_gate_test.go), throughReserveProviderEx:first_content_exploration_outcome_test.go), through the realhandleInferenceError→noteInferenceErrorglue:TestFirstContentExplorationWaitsForServiceRetirementacross scan, retained plan and commit race.go test -race ./coordinator/registry ./coordinator/api,go vet ./coordinator/registry ./coordinator/api,make coordinator-test(33 packages).make docs-impact-check BASE=origin/masterpasses.make docs-checkfails locally only on a shallow clone with thelibs/mlx-swift-lmsubmodule absent (pre-existing report and submodule links; none in files changed here). Docs changed:docs/architecture/first-content-routing.md,docs/architecture/routing.md,CHANGELOG.md.For reviewers: the policy choices
deadline_unreachableand first-content timeouts count against exploration eligibility while staying neutral for health breakers. An explored attempt that ends in either produced no evidence.Corrected 2026-09-30: an earlier revision of this description said the provider's engine reset every few minutes, from
steps_executedreturning to 0. That is normal per-interval reporting on 0.9.11 and 0.9.12. The fixture now uses a realistic 2,000 tok/s idle prefill rate instead of 20,000 (#1238).Refs #1238, #1254.
🤖 Generated with Claude Code